﻿using IOP.SgrA;
using IOP.SgrA.SilkNet.Vulkan;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VkSample91
{
    public class PresentItemGroupReneringMiddleware : IProductionLineMiddleware<VulkanContext>
    {
        public void Invoke(VulkanContext context, RenderingProductionLineDelegate<VulkanContext> next)
        {
            var render = context.GetContextRenderObject();
            var vro = render.GetComponents<VRO>().First();
            var cmd = context.CommandBuffer;

            cmd.BindVertexBuffers(0, stackalloc ulong[] { 0 }, vro.VerticesBufferInfo.Buffer);
            cmd.Draw(vro.VecticesCount, 1, 0, 0);
        }
    }
}
